package com.liuyandog.server;

import com.liuyandog.UserMain;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class UserUI extends JPanel implements ActionListener{
    /*用户界面*/
    /*界面欢迎*/
    private JLabel message;
    /*用户操作按钮*/
    private JButton info, borrow, back, record, over;
    /*字体*/
    private Font write;
    String name= UserMain.user.name;//传入的用户名
    public UserUI(){
        super();
        setLayout(null);
        message = new JLabel("尊敬的" + name + ",图书馆欢迎您！");
        over = new JButton("退出");//退出个人界面

        write = new Font("宋体", Font.BOLD, 20);

        //设置标签与按键位置
        message.setBounds(70, 30, 500, 30);
        over.setBounds(300,300,150,30);

        //设置标签与按键的字体
        message.setFont(write);
        over.setFont(write);

        //设置按钮监听
        over.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
               System.exit(0);
            }
        });

        //设置窗口
        add(message);
        add(over);
        setSize(1000,800);
    }
    public void actionPerformed(ActionEvent e){

    }

}
